<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeBehind="FilesOverview.aspx.cs" Inherits="MusicmanWeb.FilesOverview" Title="Musicman Levi9 | Overview" %>
<%@ Register Namespace="MusicmanWeb.Custom" TagPrefix="x" Assembly="MusicmanWeb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server" >

<div class="shim column"></div>

<div class="page" id="home">
    <div id="sidebar">
        <table>
            <tr>
                <td style="width: 50px;">
                    Keywords
                </td>
                <td>
                    <asp:TextBox ID="txtKeyword" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 50px;">
                    Type
                </td>
                <td>
                    <asp:DropDownList ID="JobsDDL" runat="server"  DataValueField="SearchJobID" DataTextField="Name"/>
                </td>
            </tr>
            <tr>
                <td style="width: 50px;">
                    Count
                </td>
                <td>
                    <asp:TextBox ID="txtCount" runat="server" Width="30"/>
                </td>
            </tr>
            <tr>
                <td style="width: 50px;">
                    Size > 
                </td>
                <td>
                    <asp:TextBox ID="txtMinSize" runat="server" size="2"/>
                    <select id="measureunit" runat="server">
                        <option value="1024">Kb</option>
                        <option value="1048576">MB</option>
                        <option value="1073741824">GB</option>
                    </select> 
                </td>
            </tr>            
        </table>
        <br />
        <br />
        <asp:ImageButton ID="btnSearch" runat="server" AlternateText="search" CssClass="button" SkinID="search" OnCommand="BtnSearch_Click" CommandName="search" ToolTip="Search files"/> 
        <asp:ImageButton ID="btnTopDownloads" runat="server" AlternateText="top downloads" CssClass="button" SkinID="topdownloads" OnCommand="BtnSearch_Click"  CommandName="topdownloads" ToolTip="Most downloaded"/> 
        <asp:ImageButton ID="btnTopRated" runat="server" AlternateText="top rated" CssClass="button" SkinID="toprated" OnCommand="BtnSearch_Click"  CommandName="toprated" ToolTip="Top rated"/> 
        <asp:ImageButton ID="btnLatest" runat="server" AlternateText="latest" CssClass="button" SkinID="latest" OnCommand="BtnSearch_Click"  CommandName="latest" ToolTip="Latest"/> 
        <asp:ImageButton ID="btnRandom" runat="server" AlternateText="random" CssClass="button" SkinID="random" OnCommand="BtnSearch_Click"  CommandName="random" ToolTip="Random"/> 
        <br />
        <br />                

        <table>
            <tr>
                <th colspan="2">
                    Legenda
                </th>
            </tr>
            <tr>
                <td class="oldfiles" style="width: 20px;">
                    &nbsp;
                </td>
                <td>
                    old files
                </td>
            </tr>
            <tr>
                <td class="newfiles" style="width: 20px;">
                    &nbsp;
                </td>
                <td>
                    new files
                </td>
            </tr>
        </table>
    </div>
    
    <div id="content">
        <asp:GridView ID="JobsGV" runat="server" AutoGenerateColumns="False" Width="640" OnRowDataBound="JobsGV_RowDataBound">
        <Columns>
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField HeaderText="Allcriteria" SortExpression="Allcriteria" />
            <asp:BoundField DataField="Starttime" HeaderText="Starttime" SortExpression="Starttime" ItemStyle-Wrap="false"/>
            <asp:BoundField DataField="Endtime" HeaderText="Endtime" SortExpression="Endtime" ItemStyle-Wrap="false"/>
            <asp:BoundField DataField="Totalfiles" HeaderText="Totalfiles" SortExpression="Totalfiles" ItemStyle-HorizontalAlign="Right"/>
            <asp:BoundField HeaderText="Length" ItemStyle-HorizontalAlign="Right"/>
        </Columns>
        </asp:GridView>
        <br />
        <asp:Label ID="statusLbl" runat="server" Text="" />
        <br />
        <br />
        <x:MyGridView runat="server" ID="SearchGV" 
            AutoGenerateCheckBoxColumn="True" 
            AutoGenerateColumns="false"
            DataKeyNames="SearchFileID"
            AllowPaging="True" 
            PageSize="10" 
            AllowSorting="true"
            CheckBoxColumnIndex="6" 
            visible="true" 
            Width="640px"
            OnRowDataBound="SearchGV_RowDataBound"
            onpageindexchanging="SearchGV_PageIndexChanging" 
            onsorting="SearchGV_Sorting"
            PagerSettings-Position="TopAndBottom"
            PagerSettings-Mode="NumericFirstLast">
            <Columns>
             <asp:BoundField HeaderText="Location" SortExpression="Location" ItemStyle-Width="300px" />
             <asp:BoundField HeaderText="Name" SortExpression="Name" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="300px" />
             <asp:BoundField HeaderText="Size" SortExpression="Length" ItemStyle-HorizontalAlign="Right" ItemStyle-Wrap="false"/>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton id="samefolderLB" runat="server" OnCommand="BtnSearch_Click" CommandName="samefolder" CommandArgument=<%# Eval("SearchFileID") %>><img src="../Images/folder_into.png" width="20" height="20" alt="download" /></asp:LinkButton>
                    </ItemTemplate> 
                </asp:TemplateField>                  
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href='GetFile.axd?SEARCHFILEID=<%# Eval("SearchFileID") %>'><img src="../Images/download.png" width="20" height="20" alt="download" /></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href='#' onclick="window.open('FileStats.aspx?SearchFileID=<%# Eval("SearchFileID") %>', 'filestats', ',width=600,height=400,menubar=no,breplace=yes').focus();" >
                            <img src="../Images/clipboard.png" width="20" height="20" alt="details" />
                        </a>                                    
                    </ItemTemplate> 
                </asp:TemplateField>
            </Columns>
         </x:MyGridView>
        <br />
        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Visible="false"
        Text="Add to downloads" OnCommand="AddToDownloads_Command"></asp:LinkButton>
        <br />
        <br />
    </div>
</div>
</asp:Content>
